package com.bfl.sa.showcase.sample.converter;

import com.bfl.sa.showcase.sample.entity.Sample;
import com.bfl.sa.showcase.sample.service.SampleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;

public class SampleConverter implements Converter<String, Sample> {

    @Autowired
    private SampleService sampleService;

    @Override
    public Sample convert(String id) {
        return sampleService.findOne(Long.parseLong(id));
    }
}
